import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 补充其它OID信息 */
export interface OtherOid {
          id: number; // id
          name?: string; // 中文名称
          field?: string; // 英文名称
          oid?: string; // OID
          deviceId?: number; // 设备
          addType?: string; // 类型
  }

// 补充其它OID API
export const OtherOidApi = {
  // 查询补充其它OID分页
  getOtherOidPage: async (params: any) => {
    return await request.get({ url: `/business/other-oid/page`, params })
  },

  // 查询补充其它OID详情
  getOtherOid: async (id: number) => {
    return await request.get({ url: `/business/other-oid/get?id=` + id })
  },

  // 新增补充其它OID
  createOtherOid: async (data: OtherOid) => {
    return await request.post({ url: `/business/other-oid/create`, data })
  },

  // 修改补充其它OID
  updateOtherOid: async (data: OtherOid) => {
    return await request.put({ url: `/business/other-oid/update`, data })
  },

  // 删除补充其它OID
  deleteOtherOid: async (id: number) => {
    return await request.delete({ url: `/business/other-oid/delete?id=` + id })
  },

  /** 批量删除补充其它OID */
  deleteOtherOidList: async (ids: number[]) => {
    return await request.delete({ url: `/business/other-oid/delete-list?ids=${ids.join(',')}` })
  },

  // 导出补充其它OID Excel
  exportOtherOid: async (params) => {
    return await request.download({ url: `/business/other-oid/export-excel`, params })
  },
}